[material_ui] Fix predictive back transition during CupertinoSheet drag - #12705
[material_ui] Fix predictive back transition during CupertinoSheet drag#12705huahua8893 wants to merge 1 commit into
Conversation
…ged CupertinoSheet PredictiveBackPageTransitionsBuilder and PredictiveBackFullscreenPageTransitionsBuilder chose whether to show the predictive back transition based on route.popGestureInProgress, which is navigator.userGestureInProgress -- true for any user gesture anywhere in the navigator, including dragging a CupertinoSheet that covers the route. That made the covered route incorrectly switch to the predictive back transition while an unrelated sheet was being dragged. Gate on the predictive back phase instead, which is only non-idle while an actual predictive back gesture is in progress.
There was a problem hiding this comment.
Code Review
This pull request updates PredictiveBackPageTransitionsBuilder and PredictiveBackFullscreenPageTransitionsBuilder to use the predictive back transition only when the transition phase is not idle, replacing the previous check on route.popGestureInProgress. This change prevents a covered route from initiating a predictive back transition while a CupertinoSheet is being dragged. A new widget test has been added to verify this behavior, along with a pending changelog entry. There are no review comments, and I have no feedback to provide.
|
@dkwingsmt @justinmc This is the migrated PR from flutter/flutter#187494. Could you please review the change here? Thank you! |
|
cc @justinmc - added you since you were original reviewer but let me know if you want Design team to take this. |
Ports flutter/flutter#187494 to
material_uifollowing flutter/flutter#188444.Fixes flutter/flutter#187492.
This PR fixes an issue where a route covered by a
CupertinoSheetcould incorrectly enter the predictive back transition during an unrelated navigator gesture, causing its corners to snap to the display corner radius while the sheet was being dragged.PredictiveBackPageTransitionsBuilderandPredictiveBackFullscreenPageTransitionsBuilderpreviously usedroute.popGestureInProgressto determine whether to show the predictive back transition. However, this value is derived fromnavigator.userGestureInProgress, which becomes true for any navigator user gesture, including dragging aCupertinoSheetabove the route.The resulting corner jump is visible on physical Android devices that report display corner radii. When no display corner radius is reported, the fallback value of
BorderRadius.zeromasks the visual symptom. The issue does not occur on iOS because it usesCupertinoPageTransitionsBuilder.This change uses the predictive back phase instead, so a covered route only enters the predictive back transition during an actual system back gesture. It also adds regression coverage for both predictive back transition builders.
Tests
flutter test test/predictive_back_page_transitions_builder_test.dart --no-pubdart run script/tool/bin/flutter_plugin_tools.dart analyze --packages material_uidart run script/tool/bin/flutter_plugin_tools.dart validate --packages material_ui --base-sha=9854cd5607da4001f2dd3cbdcd6903202d28958c --check-for-missing-changesdart run script/tool/bin/flutter_plugin_tools.dart publish-check --packages material_uiPre-Review Checklist
[shared_preferences]///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2